
//--------------------------------------------------------------------------------------
// Vertex input 
//--------------------------------------------------------------------------------------
struct VS_INPUT
{
	uint vertexId : SV_VertexID;
};

//--------------------------------------------------------------------------------------
// Vertex output
//--------------------------------------------------------------------------------------
struct VS_OUTPUT
{
	float4 pos : SV_Position;
	float4 color : COLOR;
};

//--------------------------------------------------------------------------------------
// Vertex Shader
//--------------------------------------------------------------------------------------
VS_OUTPUT VS ( VS_INPUT input)
{
	VS_OUTPUT output;
	
	if (input.vertexId == 0)
		output.pos = float4(0.0, 0.5, 0.5, 1.0);
	else if (input.vertexId == 1)
		output.pos = float4(0.5, -0.5, 0.5, 1.0);
	else
		output.pos = float4(-0.5, -0.5, 0.5, 1.0);

	output.color = clamp(output.pos, 0, 1);

	return output;
}


//--------------------------------------------------------------------------------------
// Pixel input 
//--------------------------------------------------------------------------------------
struct PS_INPUT
{
	float4 pos : SV_Position;
	linear float4 color : COLOR;
};

//--------------------------------------------------------------------------------------
// Pixel output 
//--------------------------------------------------------------------------------------
struct PS_OUTPUT
{
	float4 color : SV_Target;
};

//--------------------------------------------------------------------------------------
// Pixel Shader
//--------------------------------------------------------------------------------------
PS_OUTPUT PS( PS_INPUT input )
{
	PS_OUTPUT output;
	output.color = input.color;
	return output;
}
